package client;

/**
 * Abstract superclass Transaction represents a CCCS transaction
 * 
 * @author Rasmus Stjerne, Joachim Lindholm, Daniel Gramstrup, Pamela Pedersen
 */
public abstract class Transaction {
	private Display display;
	private Connection connection;

	/**
	 * Transaction constructor invoked by subclasses using super()
	 * 
	 * @param display
	 * @param connection
	 */
	public Transaction(Display display, Connection connection) {
		this.display = display;
		this.connection = connection;
	}

	/**
	 * method to return object of Display
	 * 
	 * @return reference to display
	 */
	public Display getDisplay() {
		return display;
	}

	/**
	 * method to return object of Connection
	 * 
	 * @return reference to connection
	 */
	public Connection getConnection() {
		return connection;
	}

	/**
	 * perform the transaction (overridden by each subclass)
	 */
	abstract public void execute();
}